home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Supplement / Unsupported / Optionals / Tasks < prev   
Text File  |  1986-09-30  |  719b  |  33 lines

  1. \ add background tasks to Neon
  2. \  9/29/86  cdn Updated for v2.0 -added curTask & delay
  3. Decimal
  4.  
  5. 0 value delay
  6. 0 value nullcnt
  7. 0 value curTask
  8.  
  9. \ the taskList is a queue of background tasks that will be 
  10. \ executed whenever there is a null event.
  11. 4 Ordered-Col taskList  \ up to 4 background tasks
  12.  
  13. \ add cfa to the task list 
  14. : addTask
  15.     add: taskList ;
  16.  
  17. \ remove cfa from the task list
  18. : killTask
  19.     indexof: taskList 0= ?error  152
  20.     remove: tasklist
  21.     curTask size: taskList min -> curTask ;
  22.    
  23. \ execute the tasks round-robin 
  24. : doTask size: taskList 0= IF exit THEN
  25.     nullcnt
  26.     IF -1 ++> nullcnt exit
  27.     ELSE delay -> nullcnt THEN
  28.     curTask 1+ size: taskList mod
  29.     dup -> curTask
  30.     exec: taskList ;
  31.  
  32. 'c doTask setIdle: fWind
  33.